How to Fix 'NoneType' Error When Creating Video from Images in Python